package vip.zcn.mrn.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.zcn.mrn.model.LogEntry;
import vip.zcn.mrn.service.LogParserService;

@RestController
@RequestMapping("/log")
@RequiredArgsConstructor
public class LogParserController {
    private final LogParserService logParserService;

    @PostMapping("/parse")
    public LogEntry parse(@RequestBody String logLine) {
        return logParserService.parseLog(logLine);
    }
}